<?php
session_start();
include_once("db_conect.php");
$use = $_POST["usuario"];
$pas = $_POST["password"];
$qry = "select * from usuario where eliminado = 0 and nombre = '$use' and password = '$pas'";
$res = mysql_query($qry,$conexion) or die(mysql_error());
$tot = mysql_num_rows($res);
mysql_close($conexion);
if ($tot >=1) {
	$row = mysql_fetch_array($res);
	$_SESSION["nombre"] = $row["nombre"];
	$_SESSION["perfil"] = $row["idperfil"];
} else {
	echo "no registrado";
}
?>